{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=620
  Verdict: Accepted
}
var a1,a2,b1,b2,d2,x,y,c2,c1,d1,t:double; r:boolean;
function Intersection(ax1,ay1,ax2,ay2,bx1,by1,bx2,by2:double):boolean;
var v1,v2,v3,v4:real;
begin
v1:=(bx2-bx1)*(ay1-by1)-(by2-by1)*(ax1-bx1);
v2:=(bx2-bx1)*(ay2-by1)-(by2-by1)*(ax2-bx1);
v3:=(ax2-ax1)*(by1-ay1)-(ay2-ay1)*(bx1-ax1);
v4:=(ax2-ax1)*(by2-ay1)-(ay2-ay1)*(bx2-ax1);
result:=(v1*v2<0) and (v3*v4<0);
end;
function PointOnLine(x1,y1,x2,y2,x,y:double):boolean;
begin
result:=(sqrt(sqr(x2-x1)+sqr(y2-y1)))=(sqrt(sqr(x-x1)+sqr(y-y1))+sqrt(sqr(x-x2)+sqr(y-y2)));
end;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
read(a1,a2,b1,b2,c1,c2,d1,d2);
r:=intersection(a1,a2,b1,b2,c1,c2,d1,d2);
if not r then r:=PointOnLine(a1,a2,b1,b2,c1,c2) or PointOnLine(a1,a2,b1,b2,d1,d2) or PointOnLine(c1,c2,d1,d2,a1,a2)  or PointOnLine(c1,c2,d1,d2,b1,b2);
if r then write('Yes') else write('No');
end.